<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class pow extends CI_Controller {
	var $title = "Jogja Nuws";

	public function __construct(){
		parent::__construct();
		$this->load->model(array('post_model', 'kategori_model'));
	}

	public function index($pow_id=0){
		$data['title'] = $this->title;
		$data['desc'] = "PoW (Potret Warga) Jogja";
		$data['category'] = $this->kategori_model->get_all();
		//$data['post'] = $this->post_model->get_pow();

		$this->load->library('pagination');
		$jml = $this->post_model->get_pow();
		//pengaturan pagination
		$config['base_url'] = site_url()."/pow/index";
		$config['uri_segment'] = 3;
		$config['total_rows'] = count($jml);
		$config['per_page'] = 9;
		$config['num_links'] = 4;

		/*designing pagination*/
		$config['full_tag_open'] = "<span>";
		$config['full_tag_close'] = "</span>";
		$config['prev_link'] = '<i class="fa fa-backward"></i>';
		$config['prev_tag_open'] = "<span class='page_nav'>";
		$config['prev_tag_close'] = "</span>";
		$config['num_tag_open'] = "<span>";
		$config['num_tag_close'] = "</span>";
		$config['next_link'] = '<i class="fa fa-forward"></i>';
		$config['next_tag_open'] = "<span class='page_nav'>";
		$config['next_tag_close'] = "</span>";
		$config['cur_tag_open'] = "<span class='current'>";
		$config['cur_tag_close'] = "</span>";

		$this->pagination->initialize($config);
        //buat pagination
		$data['pagger'] = $this->pagination->create_links();
		$data['post'] = $this->post_model->home_post_paged($config['per_page'], $pow_id);
		$data['total'] = $config['total_rows'];

		$this->load->view('pow/index', $data);
	}

}

/* End of file pow.php */
/* Location: ./application/controllers/pow.php */